package com.design.patterns;

interface Sender2{
    void sender();
}

class MailSender2 implements Sender2{
    public void sender(){
        System.out.println("this is mail sender...");
    }
}

class SmsSender2 implements Sender2{
    public void sender(){
        System.out.println("this is sms sender...");
    }
}

class BeanFactory{

    public static Sender2 ProduceMail(){
        return new MailSender2();
    }

    public static Sender2 ProduceSms(){
        return new SmsSender2();
    }
}
//工厂设计模式-静态工厂方法模式
public class FactoryPattern2 {

    public static void main(String[] args) {
        BeanFactory.ProduceMail();
        BeanFactory.ProduceSms();
    }
}
